<div id="notification"></div>
<div id="content"><div class="boss_frame">
  <div class="product-info">
    <?php if ($thumb || $images) { ?>
    <div class="left">
      <?php if ($thumb) { ?>
      <div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom" id='zoom1' rel=""><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a></div>
      <?php } ?>
      <?php if ($images) { ?>
    <div id="boss-image-additional">
        <?php foreach ($images as $image) { ?>
        <div><a  href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom1', smallImage: '<?php echo $image['thumb']; ?>' "><img  src="<?php echo $image['addition']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a></div>
        <?php } ?>
   </div>
      <?php } ?>
    </div>
    <?php } ?>
    <div class="right">
        <h1><?php echo $heading_title; ?></h1>
        <div class="description">
        <?php if ($manufacturer) { ?>
        -&nbsp;<span><?php echo $text_manufacturer; ?></span><?php echo $manufacturer; ?><br />
        <?php } ?>
        -&nbsp;<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
        <?php if ($reward) { ?>
        -&nbsp;<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
        <?php } ?>
        -&nbsp;<span><?php echo $text_stock; ?></span><span class="stock">&nbsp;<?php echo $stock; ?></span>
        </div>  
      <?php if ($profiles): ?>
      <div class="option">
          <h2><?php echo $text_payment_profile ?><span class="required">*</span></h2>
          <select name="profile_id">
              <option value=""><?php echo $text_select; ?></option>
              <?php foreach ($profiles as $profile): ?>
              <option value="<?php echo $profile['profile_id'] ?>"><?php echo $profile['name'] ?></option>
              <?php endforeach; ?>
          </select>
          <br />
          <span id="profile-description"></span>
            <br />
      </div>
      <?php endif; ?>
      <?php if ($options) { ?>
      <div class="options">
        <h2><?php echo $text_option; ?></h2>
        <?php foreach ($options as $option) { ?>
        
        <?php if ($option['type'] == 'select') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <select name="option[<?php echo $option['product_option_id']; ?>]">
            <option value=""><?php echo $text_select; ?></option>
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
            </option>
            <?php } ?>
          </select>
        </div>
        <?php } ?>
        
        <?php if ($option['type'] == 'radio') { ?>
        <div class="box-check"> 
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
         
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <?php foreach ($option['option_value'] as $option_value) { ?>
          <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
          </label>
          <br />
          <?php } ?>
        </div>
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'checkbox') { ?>
        <div class="box-check"> 
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <?php foreach ($option['option_value'] as $option_value) { ?>
          <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
          </label>
          <br />
          <?php } ?>
        </div>
        </div>
        <br/>
        <?php } ?>
        <?php if ($option['type'] == 'image') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
         
          <b><?php echo $option['name']; ?></b> <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <table class="option-image">
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <tr>
              <td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
              <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
              <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
                  <?php if ($option_value['price']) { ?>
                  (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                  <?php } ?>
                </label></td>
            </tr>
            <?php } ?>
          </table>
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'text') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <input class="boss-width" type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'textarea') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
         
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'file') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <span class="button"><input type="button" value="<?php echo $button_upload; ?>" id="button-option-<?php echo $option['product_option_id']; ?>" ></span>
          <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'date') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'datetime') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
         
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
        </div>
        <?php } ?>
        <?php if ($option['type'] == 'time') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          
          <b><?php echo $option['name']; ?></b><?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?><br />
          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
        </div>
        <?php } ?>
        <?php } ?>
      </div>
      <?php } ?>
         
        <div class="cart">      
        <?php if ($review_status) { ?>
          <div class="review">
            <div><img src="catalog/view/theme/bt_ebuy/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" /></div>
            
          </div>
        <?php } ?>     
        <div class="share"><!-- AddThis Button BEGIN -->
          <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
          <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script> 
          <!-- AddThis Button END --> 
        </div>
        <div class="quantity"><b><?php echo $text_qty; ?></b><br/>
            <div class="select_number">
                <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
                <div >
                    <button onclick="changeQty(1); return false;" class="increase">+</button>
                    <button onclick="changeQty(0); return false;" class="decrease">-</button>
                </div>
            </div>
            <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
          </br>
        <?php if ($minimum > 1) { ?>
        <div class="minimum"><?php echo $text_minimum; ?></div>
        <?php } ?>      
        </div>
        <?php if ($price) { ?>
        <div class="price"><em><?php echo $text_price; ?></em>
        <?php if (!$special) { ?>
        <?php echo $price; ?>
        <?php } else { ?>
        <span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
        <?php } ?>
        
        <?php if ($tax) { ?>
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span>
        <?php } ?>
        <?php if ($points) { ?>
        <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span>
        <?php } ?>
        <?php if ($discounts) { ?>
      
        <div class="discount">
          <?php foreach ($discounts as $discount) { ?>
          <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
          <?php } ?>
        </div>
        <?php } ?>
        </div>
        <?php } ?>
        <span class="button button-red"><input type="button" value="<?php echo $button_cart; ?>" id="button-cart" /></span>       
    </div>



        <div class="contact-info-product">

            <?php if($this->config->get("config_contact")) { echo html_entity_decode($this->config->get("config_contact"), ENT_QUOTES, 'UTF-8'); } ?>

        </div>


    </div>
</div>
</div></div>

<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>
<script type="text/javascript" src="catalog/view/javascript/bossthemes/cloud-zoom/cloud-zoom.1.0.3.js"></script>
<script type="text/javascript" src="catalog/view/javascript/bossthemes/owl.carousel.js"></script>
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/stylesheet/ie8.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->

<?php /******************THEME FONTS SETTINGS*********************/ ?>
<?php include "catalog/view/theme/".$this->config->get('config_template')."/template/bossthemes/Boss_font_setting.php"; ?>
<?php include "catalog/view/theme/".$this->config->get('config_template')."/template/bossthemes/Boss_color_setting.php"; ?>
<script type="text/javascript"><!--
function changeQty(increase) {
    var qty = parseInt($('.select_number').find("input").val());
    if ( !isNaN(qty) ) {
        qty = increase ? qty+1 : (qty > <?php echo $minimum; ?> ? qty-1 : <?php echo $minimum; ?>);
        $('.select_number').find("input").val(qty);
    }
}
$(document).ready(function () {
    $('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();
});
  $.fn.CloudZoom.defaults = {
    position: 'inside',
    tint: '#ffffff',
    tintOpacity: 0.5,
    lensOpacity: 0.5,
    softFocus: false,
    smoothMove: 6,
    showTitle: false,
    titleOpacity: 0.5,
    adjustX: 0,
    adjustY: 0
  }; 
//--></script> 
<script type="text/javascript"><!--
$(window).load(function(){
      $("#boss-image-additional").owlCarousel({
      items : 4,
      itemsDesktop : [1199,4],
      itemsDesktopSmall : [980,4],
      itemsTablet: [768,4],
      itemsTabletSmall: false,
      itemsMobile : [479,4],
      singleItem : false,
      //Basic Speeds
      slideSpeed : 600,
      paginationSpeed : 800,
      rewindSpeed : 1000,
      //Autoplay
      autoPlay : false,
      stopOnHover : true,
      // Responsive 
      responsive: true,
      responsiveRefreshRate : 200,
      responsiveBaseWidth: window,
      // Navigation
      navigation : true,
      scrollPerPage : true,
      //Pagination
      pagination : false,
      paginationNumbers: false,
      //Auto height
      autoHeight : true,
      //Mouse Events
      dragBeforeAnimFinish : true,
      mouseDrag : true,
      touchDrag : true
    });
});
//--></script> 
<script type="text/javascript"><!--
$('select[name="profile_id"], input[name="quantity"]').change(function(){
    $.ajax({
        url: 'index.php?route=product/product/getRecurringDescription',
        type: 'post',
        data: $('input[name="product_id"], input[name="quantity"], select[name="profile_id"]'),
        dataType: 'json',
        beforeSend: function() {
            $('#profile-description').html('');
        },
        success: function(json) {
            $('.success, .warning, .attention, information, .error').remove();
            
            if (json['success']) {
                $('#profile-description').html(json['success']);
            }   
        }
    });
});

$('#button-cart').bind('click', function() {
    $.ajax({
        url: 'index.php?route=bossthemes/cart/add',
        type: 'post',
        data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
        dataType: 'json',
        success: function(json) {
            $('.warning, .attention, information, .error').remove();
            if (json['error']) {
                if (json['error']['option']) {
                    for (i in json['error']['option']) {
                        $('#option-' + i).after('<span class="error">' + json['error']['option'][i] + '</span>');
                    }
                }
                if (json['error']['profile']) {
                    $('select[name="profile_id"]').after('<span class="error">' + json['error']['profile'] + '</span>');
                }
            }  
            if (json['success']) {
                window.parent.document.getElementById('cart-total').innerHTML = json['total'];
                javascript:void(window.parent.addProductNotice(json['title'], json['thumb'], json['success'], 'success'));
                parent.$.fancybox.close();
            }
        }
    });
    
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
    action: 'index.php?route=product/product/upload',
    name: 'file',
    autoSubmit: true,
    responseType: 'json',
    onSubmit: function(file, extension) {
        $('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
        $('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', true);
    },
    onComplete: function(file, json) {
        $('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', false);
        
        $('.error').remove();
        
        if (json['success']) {
            alert(json['success']);
            
            $('input[name=\'option[<?php echo $option['product_option_id']; ?>]\']').attr('value', json['file']);
        }
        
        if (json['error']) {
            $('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json['error'] + '</span>');
        }
        
        $('.loading').remove(); 
    }
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>

<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script> 
<script type="text/javascript"><!--
$(document).ready(function() {
    if ($.browser.msie && $.browser.version == 6) {
        $('.date, .datetime, .time').bgIframe();
    }

    $('.date').datepicker({dateFormat: 'yy-mm-dd'});
    $('.datetime').datetimepicker({
        dateFormat: 'yy-mm-dd',
        timeFormat: 'h:m'
    });
    $('.time').timepicker({timeFormat: 'h:m'});
});
//--></script>
